 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
 }
html,body{
   background-color: #F8FAFC;
}

.top-nav { background:#ffffff; border-bottom:1px solid #e2e8f0; position:sticky; top:0; z-index:50; }
.top-nav .nav-inner{ max-width:1200px; margin:0 auto; padding:8px 16px; display:flex; gap:16px; align-items:center; }
.top-nav .nav-link{ color:#334155; text-decoration:none; font-weight:500; font-size:14px; }
.top-nav .nav-link:hover{ color:#2563eb; }


body {
     font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
     line-height: 1.6;
     color: #2c3e50;
     background: #F8FAFC;
     min-height: 100vh;
 }


 .hero {
     text-align: center;
     padding: 3rem 1rem .1rem;

 }

 .hero h1 {
     font-size: clamp(2rem, 5vw, 3rem);
     font-weight: 700;
     margin-bottom: 0.5rem;
     letter-spacing: -0.02em;
 }

 .hero p {
     font-size: clamp(1rem, 2.5vw, 1.25rem);
     opacity: 0.9;
     max-width: 600px;
     margin: 0 auto 2rem;
 }

 .quick-start-btn {
     display: inline-block;
     background: rgba(255, 255, 255, 0.2);
     color: white;
     padding: 0.75rem 2rem;
     border: 2px solid rgba(255, 255, 255, 0.3);
     border-radius: 50px;
     text-decoration: none;
     font-weight: 600;
     transition: all 0.3s ease;
     backdrop-filter: blur(10px);
 }

 .quick-start-btn:hover {
     background: rgba(255, 255, 255, 0.3);
     transform: translateY(-2px);
 }


 .main-container {
     background: #f8fafc;
     border-radius: 24px 24px 0 0;
     min-height: 80vh;

     position: relative;
 }

 .container {
     max-width: 1200px;
     margin: 0 auto;
     padding: 0 2rem;
 }


 .tool-section {
     background: white;
     border-radius: 16px;
     padding: 2rem;
     box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
     margin-bottom: 3rem;
 }

 .upload-zone {
     border: 2px dashed #cbd5e0;
     border-radius: 12px;
     padding: 3rem;
     text-align: center;
     cursor: pointer;
     transition: all 0.3s ease;
     background: #f7fafc;

 }

 .upload-zone:hover {

     border-color: #3e74fe;
     background: #edf2f7;
     transform: translateY(-2px);
 }

 .upload-zone svg {

     color: #00C2F9;
     margin-bottom: 1rem;
 }

 .upload-zone h2 {
     color: #2d3748;
     margin-bottom: 0.5rem;
     font-size: 1.5rem;
 }

 .upload-zone p {
     color: #718096;
 }


 .preview-area {
     display: none;
 }

 .preview-container {
     text-align: center;
     margin-bottom: 2rem;
     display: flex;
     justify-content: center;
 }

 #imageCanvas {
     border: 1px solid #e2e8f0;
     border-radius: 8px;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
 }

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

 legend {
     font-weight: 600;
     color: #2d3748;
     padding: 0 0.5rem;
 }

 input[type="radio"] {
     margin-right: 0.5rem;
 }

 label {
     font-weight: 500;
     color: #4a5568;
 }

 input[type="range"] {
     width: 100%;
     margin-top: 0.5rem;
 }

.buttonBox {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem .75rem;
}

  .btn {
     background: #03BDF9;
     color: white;
     padding: 1rem 1.5rem;
     border: none;
     border-radius: 6px;
     cursor: pointer;
     font-weight: 600;
     transition: all 0.3s ease;
     font-size: 1.1rem;
     text-align: center;
 }

 .buttonBox .btn:hover {
     background: #397AFE;
 }

 #resetBtn {
     background: #FC4B51;
     /* margin-left: 0.5rem; */
 }

 #resetBtn:hover {
     background: #E53E3E;
 }


 .quick-guide {
     background: white;
     border-radius: 16px;
     margin-bottom: 3rem;
     overflow: hidden;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
 }

 .guide-header {
     background: linear-gradient(135deg, #00C2F9, #3e74fe);

     color: white;
     padding: 1.5rem 2rem;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: space-between;
     transition: all 0.3s ease;
 }

 .guide-header:hover {}

 .guide-content {
     padding: 0;
     max-height: 0;
     overflow: hidden;
     transition: all 0.3s ease;
 }

 .guide-content.open {
     padding: 2rem;
     max-height: 500px;
 }

 .guide-steps {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
     gap: 1.5rem;
 }

 .step {
     text-align: center;
     padding: 1.5rem;
     background: #f7fafc;
     border-radius: 12px;
 }

 .step-number {
     background: #667eea;
     color: white;
     width: 32px;
     height: 32px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     margin: 0 auto 1rem;
     font-weight: 700;
 }


 .features {
     margin-bottom: 3rem;
 }

 .section-title {
     text-align: center;
     color: #2d3748;
     font-size: 2rem;
     font-weight: 700;
     margin-bottom: 2rem;
 }

 .features-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
     gap: 2rem;
 }

 .feature-card {
     background: white;
     padding: 2rem;
     border-radius: 16px;
     text-align: center;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
     transition: all 0.3s ease;
 }

 .feature-card:hover {
     transform: translateY(-4px);
     box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
 }

 .feature-icon {
     width: 60px;
     height: 60px;

     background: linear-gradient(135deg, rgba(0, 194, 249, 0.1), rgba(62, 116, 254, 0.1));

     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     margin: 0 auto 1rem;
     color: white;
     font-size: 1.5rem;
 }

 .feature-card h3 {
     color: #2d3748;
     margin-bottom: 0.5rem;
     font-size: 1.25rem;
 }

 .feature-card p {
     color: #718096;
     line-height: 1.6;
 }


 .use-cases {
     background: white;
     padding: 3rem 2rem;
     border-radius: 16px;
     margin-bottom: 3rem;
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
 }

 .use-cases-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
     gap: 2rem;
     margin-top: 2rem;
 }

 .use-case {
     text-align: center;
     padding: 1.5rem;
     background: #f8fafc;
     border-radius: 12px;
     transition: all 0.3s ease;
 }

 .use-case:hover {
     background: #edf2f7;
     transform: translateY(-2px);
 }

 .use-case-icon {
     font-size: 2rem;
     margin-bottom: 1rem;
 }


 .why-choose {
     margin-bottom: 3rem;
 }

 .benefits-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
     gap: 1.5rem;
 }

 .benefit {
     background: white;
     padding: 1.5rem;
     border-radius: 12px;
     display: flex;
     align-items: center;
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
     transition: all 0.3s ease;
 }

 .benefit:hover {
     transform: translateY(-2px);
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
 }

 .benefit-icon {
     width: 48px;
     height: 48px;

     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     margin-right: 1rem;
     color: white;
     font-size: 1.2rem;
 }

 .benefit-text h4 {
     color: #2d3748;
     margin-bottom: 0.25rem;
     font-size: 1rem;
 }

 .benefit-text p {
     color: #718096;
     font-size: 0.9rem;
     line-height: 1.4;
 }


footer {
    background: #2d3748;
    color: #a0aec0;
    text-align: center;
    padding: 2rem;

}

 footer p {
     margin-bottom: 0.5rem;
 }


@media (max-width: 768px) {
     .hero {
         padding: 2rem 1rem .1rem;
     }

     /* .container {
         padding: 1rem;
     } */

     .tool-section {
         padding: 1.5rem;
     }

     .upload-zone {
         padding: 2rem 1rem;
     }

    .controls { grid-template-columns: 1fr; }

    .buttonBox { grid-template-columns: 1fr; }

     .benefits-grid {
         grid-template-columns: 1fr;
     }

     .guide-steps {
         grid-template-columns: 1fr;
     }

    .guide-content.open {
        padding: 2rem;
        max-height: max(780px, 85vh);
        
    }
}


 @keyframes fadeInUp {
     from {
         opacity: 0;
         transform: translateY(20px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 .tool-section {
     animation: fadeInUp 0.6s ease-out;
 }

 /* ios */
 select {
    -webkit-appearance: menulist;
    appearance: menulist;
}

/* thumbnail strip for batch */
.thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 1rem;
}

.ratio-tabs { 
    display: flex; gap: 8px; margin: 0 0 10px 0; flex-wrap: wrap;
}
.ratio-tab { 
    padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 16px; cursor: pointer; background:#fff; font-size: 12px;
}
.ratio-tab.active { 
    border-color:#3e74fe; color:#3e74fe; background: #eef3ff;
}
.ratio-previews { display:flex; gap:8px; align-items:center; margin: 8px 0 18px; overflow-x:auto; }
.ratio-prev-item { display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.ratio-prev-canvas { border:1px solid #e2e8f0; border-radius:6px; }

.thumb-add {
    min-width: 96px; /* will be overridden inline for ratio height */
    height: 96px;    /* keep square default */
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    cursor: pointer;
    color:#475569;
    font-weight:600;
}

.thumb-tile {
    position: relative;
    display: inline-block;
}

.thumb-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FC4B51;
    color: #fff;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    z-index: 3;
}
.preset-rows { display:flex; flex-direction:column; gap:16px; margin-top:10px; }
.preset-row { background:#fff; border:1px solid #e2e8f0; border-radius:8px; padding:10px; }
.preset-row-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.preset-row-title { font-weight:600; color:#2d3748; }
.preset-row-actions { display:flex; align-items:center; gap:10px; }
.preset-thumbs { display:flex; gap:8px; overflow-x:auto; padding-top:4px; }
/* JS handles smooth scrolling precisely; avoid snap to prevent unexpected jumps */
.preset-thumb-canvas { border:1px solid #e2e8f0; border-radius:6px; cursor:pointer; }
.btn-link { padding:.35rem .6rem; border:1px solid #e2e8f0; border-radius:6px; background:#fff; cursor:pointer; }

#presetAdd { max-width:100%; overflow-x:auto; }

@media (max-width: 768px) {
  #presetAdd { display:block; }
  #presetAdd label, #presetAdd button { display:block; margin:6px 0; }
}
#namingPattern{ width:100%; max-width:380px; }
.np-tokens{ display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.np-tokens label{ display:inline-flex; align-items:center; gap:6px; }

#customPresetPanel{ display:none; flex-wrap:wrap; gap:8px; align-items:center; }
#customPresetPanel input[type="text"],
#customPresetPanel input[type="number"],
#customPresetPanel button{ height:32px; }
#presetAdd button{ height:32px; }
